import GameUtils from "./GameUtils";
import HttpHelper from "./HttpHelper";

const { ccclass, property } = cc._decorator;
@ccclass
export default class HttpApiUtils {

    static RequestDataType = {
        GameConfig: "/game/config",
        GameSync: "/game/sync",
        GameMessage: "/game/message",
        MallGameCashOut: "/mall/game/cash/out",
        MallValidFriend: "/mall/valid/friend",
        DailyCustom: "/game/get/daily/custom",
        AddDailyCustom: "/game/add/daily/custom",
        TaskGetHomePageTask: "/task/getHomePageTask",
        TaskFinishTask: "/task/finish/daily",
        AddDailyactive: "/game/add/daily/active",
        MallGameHistory: "/mall/game/history",
        VersionUpdate: "/version/hotUpdate",
        GameAddRedBag: "/game/add/red/bag",
        GameAccount: "/game/account",
        AddDailyAlive: "/game/add/daily/alive",
        GetDailyAlive: "/game/get/daily/alive",
        h5userMassage: "/user/message",
        mallCahout: "/mall/game",
        punchClockData: "/game/sign/reward/list",
        punchClockCashout: "/game/sign/reward",
        cashoutData: "/mall/cash/list",
        inviterecordData: "/mall/getOrderList",
        recordData: "/mall/game/history",
        goCashout: "/mall/withdraw",
        getMallInfo: "/mall/game/cash/list",
        common: "/app/common",
        SevenCashActivityInfo: "/activityDetail",
        SevenCashCarousel: "/carousel",
        SevenCashWithdraw: "/three/withdraw",
        GameConfVersion: "/version/hotUpdate",//"game/conf/version",
        add_money_reward: "/game/add/money/reward",
        extra_reward: "/game/money/extra/reward",
        mall_money_cash_list: "/mall/money/cash/list",
        dunamic_config: "/game/dynamic/config",
        GameRealLevelSync: "/game/real/level/sync",
        GameSysTime: "/game/sysTime",
        GameRealMenulSync: "/game/real/menu/sync",
        EverydayDetail: "/game/everyday/detail",
        EverydayAward: "/game/everyDay/award",
        AddBankNote: "/game/add/bankNote",
        Barrage: "/game/barrage",
        GameAddEcpmReward: "/game/add/ecpm/reward",
        LuckyRateValue: "/game/lucky/value",
        adConfig: "/game/backstage/config",
        userStage: "/game/userStage",
        alipayExtract: "/alipayExtract/getConfig",
        alipayReceive: "/alipayExtract/receive",
        rateChange: "/game/config/rateChange",
        attributeSource: "/game/attributeSource",
        rewardConfig: "/config/rewardConfig",
        rewardExtract: "/game/rewardExtract",
        arraignStatus: "/game/arraignStatus",
        logOff: "/user/logoff"
    }

    static m_instance: HttpApiUtils = null;
    static OK_CODE = 0;
    static ERROR_CODE = -1;

    // let n = require("./common/CommonEnum"), s = require("./managers/DataManager"), r = require("./HttpHelper");

    static get Instance() {
        null == HttpApiUtils.m_instance && (HttpApiUtils.m_instance = new HttpApiUtils());
        return HttpApiUtils.m_instance;
    }

    public requestserver_getData(url: string, sucCb, failCb, params = {}) {
        // if (!this.fakeData(url, sucCb)) {
        //     let i = url.includes("http") ? url : DataManager.Instance.getServerUrl() + "" + url;
        //     HttpHelper.httpHelper.httpPost(i, params, sucCb, failCb);
        // }
    }
};
